package com.biz.primus.ms.auth.api;

import com.biz.primus.base.enums.CommonStatus;
import com.biz.primus.ms.auth.dao.po.MenuGroup;
import com.biz.primus.ms.auth.dao.po.Role;
import com.biz.primus.ms.auth.service.MenuGroupService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Created by younger on 17/11/7.
 */
@RestController
@RequestMapping("soa/menuGroupService")
public class MenuGroupApiController {
    private final MenuGroupService menuGroupService;

    @Autowired
    public MenuGroupApiController(MenuGroupService menuGroupService){
        this.menuGroupService = menuGroupService;
    }

    @ApiOperation("获取用户的权限")
    @PostMapping("findEnabledMenuGroups")
    public List<MenuGroup> findEnabledMenuGroups(){
        List<MenuGroup> menuGroupList = menuGroupService.findEnabledMenuGroups();
        return menuGroupList;
    }
}
